using UnityEngine;
using System.Collections;

public class Gafanhotos : MonoBehaviour {

    public float vel, time;
	private float timer;
	// Use this for initialization
	void Start () {
	   timer = 0.0f;
	}
	
	// Update is called once per frame
	void Update () 
	{
	       timer += Time.deltaTime;
	       
		   
		   if(timer < time)
		   {
		      transform.Translate(vel * Time.deltaTime,0,0);
		   }
		   
		   else
		   {
		      vel = -vel; timer = 0.0f; 
		   }
		   
		  
	}
	
	
}
